package com.wanbangee.marksystem.service.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wanbangee.marksystem.dao.UGradeDao;
import com.wanbangee.marksystem.entities.UGrade;
import com.wanbangee.marksystem.entities.USchool;
import com.wanbangee.marksystem.service.UGradeService;
@Service
public class UGradeServicelmp implements UGradeService {

	@Autowired
	private UGradeDao uGradeDao;
	@Override
	public List<USchool> selectUSchool() {
		// TODO Auto-generated method stub
		return this.uGradeDao.selectUSchool();
	}
	@Override
	public List<UGrade> selectGradeBySchId(Integer schId) {
		// TODO Auto-generated method stub
		return this.uGradeDao.selectGradeBySchId(schId);
	}
	@Override
	public Integer insertGrade(UGrade uGrade) {
		// TODO Auto-generated method stub
		return this.uGradeDao.insertGrade(uGrade);
	}
	@Override
	public Integer updateGrade(UGrade uGrade) {
		// TODO Auto-generated method stub
	    	return this.uGradeDao.updateGrade(uGrade);
	}
	@Override
	public Integer deleteGrade(Integer graId) {
		// TODO Auto-generated method stub
	    	return this.uGradeDao.deleteGrade(graId);
	}
	@Override
	public Integer updateGradeStateBygraIdAndgraState(Integer graId, Integer graState) {
		// TODO Auto-generated method stub
		if(this.uGradeDao.updateGradeStateBygraIdAndgraState(graId, graState)==1) {
			return 1;
		}
		return 0;
	}
	@Override
	public UGrade selectGradeByGraId(Integer graId) {
		// TODO Auto-generated method stub
		return this.uGradeDao.selectGradeByGraId(graId);
	}
	
}
